<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function ShowRandom(){
            this.number = parseInt(Math.random()*10+1)

        }
        ShowRandom.prototype.show = function(){
            console.log(this.number)
        }
        ShowRandom.prototype.show2 = function(){
            window.setInterval(this.show.bind(this),1000)
        }
        var num = new ShowRandom()
        num.show2()
        // 两个this的用法。
  </script>
</body>
</html>